unit gui_form_tiatai_output;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
  ExtCtrls, SystemManager, basicio_field, basicio_Resources, basicio_city,
  basicio_street;

type

  { TTTiatai_OutputForm }

  TTTiatai_OutputForm = class(TForm)
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    Button4: TButton;
    Button5: TButton;
    Button6: TButton;
    Button7: TButton;
    Button8: TButton;
    Button9: TButton;
    Edit1: TEdit;
    Edit10: TEdit;
    Edit11: TEdit;
    Edit12: TEdit;
    Edit13: TEdit;
    Edit14: TEdit;
    Edit15: TEdit;
    Edit16: TEdit;
    Edit17: TEdit;
    Edit2: TEdit;
    Edit3: TEdit;
    Edit4: TEdit;
    Edit5: TEdit;
    Edit6: TEdit;
    Edit7: TEdit;
    Edit8: TEdit;
    Edit9: TEdit;
    Label1: TLabel;
    Label10: TLabel;
    Label11: TLabel;
    Label12: TLabel;
    Label13: TLabel;
    Label14: TLabel;
    Label15: TLabel;
    Label16: TLabel;
    Label17: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    Label7: TLabel;
    Label8: TLabel;
    Label9: TLabel;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
    procedure Button5Click(Sender: TObject);
    procedure Button6Click(Sender: TObject);
    procedure Button9Click(Sender: TObject);
  private
    { private declarations }
  public
    { public declarations }
  end;

implementation

{$R *.lfm}

{ TTTiatai_OutputForm }

procedure TTTiatai_OutputForm.Button1Click(Sender: TObject);
var
  pos: TFieldPosition;
begin
  pos.x:= strtoint(Edit1.Text);
  pos.y:= strtoint(Edit2.Text);
  GlobalSystemManager.IO.Output.MoveThief(pos);
end;

procedure TTTiatai_OutputForm.Button2Click(Sender: TObject);
var
  pos: TCityPosition;
begin
  pos.x:= strtoint(Edit3.Text);
  pos.y:= strtoint(Edit4.Text);
  GlobalSystemManager.IO.Output.ThiefCity(pos);
end;

procedure TTTiatai_OutputForm.Button3Click(Sender: TObject);
var
  res: TResources;
begin
  res.Wood:=strtoint(Edit5.Text);
  res.Dirt:=strtoint(Edit6.Text);
  res.Sheeps:=strtoint(Edit7.Text);
  res.Wheat:=strtoint(Edit8.Text);
  res.Ore:=strtoint(Edit9.Text);
  GlobalSystemManager.IO.Output.ThrowRes(res);
end;

procedure TTTiatai_OutputForm.Button4Click(Sender: TObject);
var
  pos: TStreetPosition;
begin
  pos[0].x:= strtoint(Edit10.Text);
  pos[0].y:= strtoint(Edit11.Text);
  pos[1].x:= strtoint(Edit12.Text);
  pos[1].y:= strtoint(Edit13.Text);
  GlobalSystemManager.IO.Output.BuildStreet(pos);
end;

procedure TTTiatai_OutputForm.Button5Click(Sender: TObject);
  var
  pos: TCityPosition;
begin
  pos.x:= strtoint(Edit14.Text);
  pos.y:= strtoint(Edit15.Text);
  GlobalSystemManager.IO.Output.BuildCity(pos);
end;

procedure TTTiatai_OutputForm.Button6Click(Sender: TObject);
  var
  pos: TCityPosition;
begin
  pos.x:= strtoint(Edit16.Text);
  pos.y:= strtoint(Edit17.Text);
  GlobalSystemManager.IO.Output.ExtendCity(pos);
end;

procedure TTTiatai_OutputForm.Button9Click(Sender: TObject);
begin
  GlobalSystemManager.IO.Output.EndTurn;
end;

{
  procedure TradeResult(AResult: boolean); virtual;
  procedure GenerateTradeOffer(AOffer: TTradeOffer); virtual;
                                                     }


end.

